package com.shycloud.mido.member.api.vo;

import com.shycloud.mido.common.core.constant.CommonConstants;
import lombok.Data;

/**
 * @author Xiaoxing Yu
 * @date 2020/12/17 上午11:32
 **/
@Data
public class AccessRoomReturnVO {

	private Integer code;

	private Boolean status;

	private String message;

	private String token;

	private String channel;

	private String teacherId;

	private String studentId;

	public void setFailed(String message) {
		this.message = message;
		this.status = false;
		this.code = CommonConstants.FAIL;
	}

	public void setSuccess(String message, Integer type, String id) {
		this.status = true;
		this.code = CommonConstants.SUCCESS;
		//0-老师 1-学生
		if (type == 0) {
			this.teacherId = id;
			this.message = new StringBuffer("老师").append(message).toString();
		} else {
			this.studentId = id;
			this.message = new StringBuffer("学生").append(message).toString();
		}
	}

	public void setData(String token, String channel) {
		this.token = token;
		this.channel = channel;
	}

}
